package com.ms.service.impl;

import com.ms.mapper.AdminMapper;
import com.ms.pojo.Admin;
import com.ms.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl  implements AdminService {
    @Autowired
    private AdminMapper adminMapper;
    @Override
    public Admin adminlogin(String adminUsername, String adminPassword){
        // 检查参数是否为空
        if (adminUsername == null || adminUsername.isEmpty() || adminPassword == null || adminPassword.isEmpty()) {
            return null;
        }
        // 查询管理员信息
       Admin admin = adminMapper.selectByAdminnameAndPassword(adminUsername, adminPassword);
        // 检查用户是否存在
        if (admin == null) {
            return null;
        }return admin ;
    }
}
